<%@ page import="java.awt.*" %>
<%@ page import="java.util.List" %>
<%@ page import="pojo.ST" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2022/3/1
  Time: 10:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script language="JavaScript">
        if(objStatus=="更新成功"){
            alert("更新成功");
        }
        // function A() {
        //     alert(objStatus);
        //     if( objStatus =="A"){
        //         $("#op option[value='A']").attr("selected", "selected");
        //     }else {
        //         $("#op option[value='L']").attr("selected", "selected");
        //     }
        // }
        <%--$(function(){--%>
            <%--var a=${objStatus.op};--%>
            <%--if(${objStatus}=="A")--%>
            <%--{--%>
                <%--$("#op").find("option[value='" + a + "']").attr("selected", true);--%>
            <%--}--%>
            <%--});--%>

        function left()
        {
            document.form1.action="/AlterServlet";
            document.form1.method="get";
            document.form1.submit();
        }
        function right()
        {
            document.form1.action="/AlterServlet2";
            document.form1.method="get";
            document.form1.submit();
        }
    </script>
<style>
    body{
        background-image:linear-gradient(to right, #ffc6e2, #ccb4ff);
    }

   .test2{
        background-color: white ;
        width: 500px;
        height: 150px;
        border-radius: 20px;
        opacity: 0.9;
       position: absolute;
       top: 120px;
       left: 430px;
    }

    .test1{
        background-color: white ;
        width: 500px;
        height: 100px;
        border-radius: 20px;
        opacity: 0.9;
        position: absolute;
        top: 300px;
        left: 430px;
    }
    .alter2 {
        border: 2px solid #080a0b;
        border-radius: 10px;
        width: 200px;
        height: 35px;

    }


    button{
        background-color: white;
        color: #c7a9ff;

    }
    a{
        text-decoration:none;
    }
    h2{
        color: black;
        text-align: center;
        vertical-align:middle;
    }


</style>
</head>
<body>
<button><a href="Alter.jsp">上一页</a></button>

<form name="form1" action="" method="">
    <div class="test1" style="text-align:center;vertical-align:middle;">
    <%
        String objId = "";
        String objStatus = "";
        try {
            String an= (String)request.getAttribute("obj_data2");
            List<ST> stList= (List<ST>) request.getAttribute("obj_data1");
            System.out.println(stList.size());
            for (int i = 0; i < stList.size(); i++) {
                out.print(stList.get(i).getStudentID() + " ");
                out.print(stList.get(i).getStudentName() + " ");
                out.print(stList.get(i).getStudentDate() + " ");
                out.print(stList.get(i).getStudentNumber() + " ");
                out.print(stList.get(i).getStudentSemester() + " ");
                // out.print(stList.get(i).getStudentStatus()+"</br>");
                objStatus = stList.get(i).getStudentStatus();
                objId = stList.get(i).getStudentID();
                request.setAttribute("objId", objId);
                request.setAttribute("objStatus", objStatus);
                System.out.println(objStatus);
            }
           // request.setAttribute("objan",an);
        }catch (Exception e){
            e.printStackTrace();
        }

    %>


    <select name="op" id="op">
        <option value="A">A</option>
        <option value="L">L</option>
    </select> <br>
    <input type="submit" value="确认提交" onClick="right()">
    </div>
        <div class="test2"style="text-align:center;vertical-align:middle;">
            <h2>请输入您要修改的学生ID</h2><input class="alter2" name="id" value=<%= objId %> ><br>
            <input type="submit" value="确认" onClick="left()" >
        </div>
</form>



</body>
</html>
